<template>
	<view>
		<view class="ser">
			<view class="sertt">
				<view class="left" v-for="(item,index) in dataList" :key="index" @click="segr(item)">
					<view class="boxer" > 
						<image class="sert" style="width: 100%;height: 180rpx;" :src="item.image"></image>
						<view style="font-size: 25rpx;font-weight: 600;">{{ item.name }}</view>
						<view style="font-size: 15rpx; color: #999999 ;">{{item.address }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data(){
			return{
				trues:true,
				dataList:[],
				page:1,
			}
		},
		onReachBottom(){
			this.init();	
		},
		
		onLoad() {
			this.init();
		},
		methods:{
			init(){
				let obj = {
					page: this.page
				}
				// 未封装前数据接口 https://app.qdmmdj.com/public/index.php/api/store/index
				this.$http.post('/api/store/index',obj).then(res =>{
					let { list ,total } = res;
					this.dataList.push(...list);
					this.page++
				})
			},
			segr(item){
				// 根据id跳转页面
				uni.navigateTo({
					url:`/bundle/pages/home/homeser?id=${item.id}`
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	page{
		background-color: #f5f5f5;
	}
	.ser{
		width: 85%;
		margin: 0rpx auto;
	}
	.sert{
		border-radius: 15rpx;
	}
	.sertt{
		width: 100%;
		height: 300rpx;
		display: flex;
		justify-content: space-between;
		flex-flow: wrap;
	}
	.left{
		width: 47%;
		background-color: white;
		height: 100%;
		margin-top: 30rpx;
		// height: 1;
	}
	.boxer{
		width: 90%;
		height: 90%;
		margin: 20rpx auto;
		display: flex;
		    flex-direction: column;
		    justify-content: space-between;
		    align-items: center;
	}
</style>